package com.vates.curso.entities;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.vates.curso.utils.BaseObject;

@Entity
@Table(name = "USER")
public class User extends BaseObject {

	@Id
	@Column(name = "USER_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long userId;
	@Column(name = "USER_ENABLE")
	private boolean userEnable;
	@Column(name = "USER_LOCKED")
	private boolean userLocked;
	@Column(name = "USER_USER_NAME")
	private String userName;
	@Column(name = "USER_PASSWORD")
	private String userPassword;
	@Column(name = "USER_FIRST_NAME")
	private String userFirstName;
	@Column(name = "USER_LAST_NAME")
	private String userLastName;
	@OneToMany(fetch = FetchType.EAGER, mappedBy = "phoneUser", cascade = CascadeType.ALL)
	private Set<Phone> userPhone;
	// @Column(name="number")
	// private Role userRole;
	@Column(name = "USER_DIRECCION")
	private String userDireccion;
	@Column(name = "USER_BARRIO")
	private String userBarrio;
	@OneToMany(fetch = FetchType.EAGER, mappedBy = "roleUser", cascade = CascadeType.ALL)
	private Set<Role> userRole;

	public User() {
		super();
	}

	public User(Long userId, boolean userEnable, boolean userLocked,
			String userName, String userPassword, String userFirstName,
			String userLastName, Set<Phone> userPhone, String userDireccion,
			String userBarrio, Set<Role> userRole) {
		super();
		this.userId = userId;
		this.userEnable = userEnable;
		this.userLocked = userLocked;
		this.userName = userName;
		this.userPassword = userPassword;
		this.userFirstName = userFirstName;
		this.userLastName = userLastName;
		this.userPhone = userPhone;
		this.userDireccion = userDireccion;
		this.userBarrio = userBarrio;
		this.userRole = userRole;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public boolean isUserEnable() {
		return userEnable;
	}

	public void setUserEnable(boolean userEnable) {
		this.userEnable = userEnable;
	}

	public boolean isUserLocked() {
		return userLocked;
	}

	public void setUserLocked(boolean userLocked) {
		this.userLocked = userLocked;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getUserFirstName() {
		return userFirstName;
	}

	public void setUserFirstName(String userFirstName) {
		this.userFirstName = userFirstName;
	}

	public String getUserLastName() {
		return userLastName;
	}

	public void setUserLastName(String userLastName) {
		this.userLastName = userLastName;
	}

	public Set<Phone> getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(Set<Phone> userPhone) {
		this.userPhone = userPhone;
	}

	public String getUserDireccion() {
		return userDireccion;
	}

	public void setUserDireccion(String userDireccion) {
		this.userDireccion = userDireccion;
	}

	public String getUserBarrio() {
		return userBarrio;
	}

	public void setUserBarrio(String userBarrio) {
		this.userBarrio = userBarrio;
	}

	public Set<Role> getUserRole() {
		return userRole;
	}

	public void setUserRole(Set<Role> userRole) {
		this.userRole = userRole;
	}

	@Override
	public void equals() {
		// TODO Auto-generated method stub

	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

}
